/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package Entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author guillaumediliberatore
 */
@Entity
@Table(name = "expert")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Expert.findAll", query = "SELECT e FROM Expert e"),
    @NamedQuery(name = "Expert.findByIdexpert", query = "SELECT e FROM Expert e WHERE e.idexpert = :idexpert"),
    @NamedQuery(name = "Expert.findByLogin", query = "SELECT e FROM Expert e WHERE e.login = :login"),
    @NamedQuery(name = "Expert.findByPwd", query = "SELECT e FROM Expert e WHERE e.pwd = :pwd")})
public class Expert implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idexpert")
    private Integer idexpert;
    @Size(max = 30)
    @Column(name = "login")
    private String login;
    @Size(max = 30)
    @Column(name = "pwd")
    private String pwd;

    public Expert() {
    }

    public Expert(Integer idexpert) {
        this.idexpert = idexpert;
    }

    public Expert( String login, String pwd){
        this.login=login;
        this.pwd=pwd;
    }
            
            
    public Integer getIdexpert() {
        return idexpert;
    }

    public void setIdexpert(Integer idexpert) {
        this.idexpert = idexpert;
    }

    public String getLogin() {
        return login;
    }

    public void setLogin(String login) {
        this.login = login;
    }

    public String getPwd() {
        return pwd;
    }

    public void setPwd(String pwd) {
        this.pwd = pwd;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idexpert != null ? idexpert.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Expert)) {
            return false;
        }
        Expert other = (Expert) object;
        if ((this.idexpert == null && other.idexpert != null) || (this.idexpert != null && !this.idexpert.equals(other.idexpert))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entity.Expert[ idexpert=" + idexpert + " ]";
    }
    
}
